package main.java.game.command;
import main.java.game.Battle;
import main.java.game.combatant.Hero;
import main.java.game.combatant.Monster;
import main.java.game.item.sorcery.Sorcery;
import main.java.game.item.sorcery.SorceryType;


/**
 * @author  ILDiNHo
 */
public class UseSorcery implements BattleCommand {

	/**
	 * @uml.property  name="battle"
	 * @uml.associationEnd  
	 */
	private Battle battle;
	/**
	 * @uml.property  name="sorcery"
	 * @uml.associationEnd  
	 */
	private Sorcery sorcery;
	
	public UseSorcery(Battle battle, Sorcery sorcery){
		this.battle=battle;
		this.sorcery=sorcery;
	}
	public void execute() {
		Hero hero=battle.getHero();
		Monster monst=battle.getMonster();
		String n=sorcery.getName();
		sorcery.use(hero);
		
		if(n.equals(SorceryType.STRENGTHEN)){
			hero.setAttack(hero.getAttack()+3);
			//hasta final del turno
		}else if(n.equals(SorceryType.WEAKEN)){
			monst.setDefense(monst.getDefense()-2);
			//hasta final del turno
		}else if(n.equals(SorceryType.FORMFATE)){
			//ordena a tu gusto las 7 primeras cartas del juego
		}
	}
	public Battle getAssociatedBattle(){
		return battle;
	}
}
